package com.geo.geoProject.client.UI.docks;

import com.google.gwt.core.client.GWT;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.DragAppearance;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;

public class Icone extends Img {
    public Icone() {  
        setWidth(48);  
        setHeight(48);  
        setLayoutAlign(Alignment.CENTER);  
        setCanDragReposition(true);  
        setCanDrop(true);  
        setDragAppearance(DragAppearance.TARGET);  
        setAppImgDir(GWT.getModuleBaseURL()+"images/pieces/48/");  
    }  
      
    public Icone(String src) {  
        this();  
        setSrc(src);  
    }
    
    
    public Icone(String src, final Runnable r) {   
        this();  
        setSrc(src);
        this.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				r.run() ;
			}
		}) ;
    }
}
